﻿<%@ Page Language="C#" MasterPageFile="~/admin/Admin.master" AutoEventWireup="true" CodeFile="DanhsachLK.aspx.cs" Inherits="admin_DanhsachLK" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript">
    function isconfirm() {
        var ck = confirm('Bạn có chắc xoá hay không?');
        if (ck == true)
            return true;
        else
            return false;
    }

        </script>

    <form id="form1" runat="server">
    <table style="width:101%; height: 228px;">
        <tr>
            <td style="width: 563px">
            <table  cellpadding="1" cellpadding="1"  border="1" style="width: 600px">
                <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1" 
                    onitemcommand="Repeater1_ItemCommand1">
                <HeaderTemplate>
                <tr>
                            <th align ="left">Mã LK</th>
							<th align ="left">Tên LK</th>
							<th align ="left">Giá bán</th>
							<th align ="left">Số lượng</th>							
							<th align ="left">Loại LK</th>	
							<th align ="left">Xoá </th>
							<th align ="left">Sửa </th>			
                            
                </tr>
                </HeaderTemplate>
                <ItemTemplate>              
                <tr>
                             <td align ="left"><asp:HyperLink ID="hplMaLinhKien" runat="server" NavigateUrl='<%# "~/ThemLK.aspx?malinhkien=" + DataBinder.Eval(Container.DataItem,"malinhkien")%>' Text='<%# DataBinder.Eval(Container.DataItem,"malinhkien")%>' /></td>
							<td align ="left"><%#Eval("tenlinhkien")%></td>
							<td align ="left"><%#Eval("giaban")%></td>
							<td align ="left"><%#Eval("soluong")%></td>							
							<td align ="left"><%#Eval("loailk")%></td>
							<td align ="left"><asp:ImageButton ID="imagebtxoa" runat="server" CommandArgument='dk' CommandName="Xoa" OnClientClick='return isconfirm()'
            ImageUrl="images/action_remove.png" /></td>     
                            <td>  <a href="SuaLK.aspx?malinhkien=<%#Eval("malinhkien")%>"> <img src="images/action_check.png"  alt ="Check" id ="check" />  </a> 
                                 
                            </td> 
                           
                </tr>
                </ItemTemplate>
                
                
                
                
                </asp:Repeater>
                </table>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:maytinhxachtayConnectionString %>" 
                    SelectCommand="SELECT [MaLinhKien], [TenLinhKien], [GiaBan], [SoLuong], [LoaiLK] FROM [LinhKien]">
                </asp:SqlDataSource>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 563px">
                <asp:Repeater ID="Repeater2" runat="server">
                </asp:Repeater>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        </table>
    </form>
</asp:Content>

